<%@ page import="java.util.Enumeration" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/3/28
  Time: 22:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <form action="regist" method="post">
        姓名:<input type="text" name="name" value=""><br>
        性别:<input type="text" name="sex" value=""><br>
        爱好:
        <input type="checkbox" name="hobby" value="抽烟">抽烟<br>
        <input type="checkbox" name="hobby" value="喝酒">喝酒<br>
        <input type="checkbox" name="hobby" value="烫头">烫头<br>
        <input type="submit" value="提交">
    </form>


    <%
        String value = request.getHeader("key");
          Enumeration en = request.getHeaderNames();//获取全部的key
        System.out.println("request.getHeader value-》" + value);
        while(en.hasMoreElements()){
            String key = (String)en.nextElement();//获取某一个key
            String val = request.getParameter(key);
            System.out.println("request.getHeaderNames key-》"+key+"   //val-》"+val);
        }
    %>
</body>
</html>
